1. Field of Invention
This invention relates to an information processing device, a method of saving and loading data, and an information recording medium. In particular, this invention relates to an information processing device, and a method of saving and loading data, which determines the cause(s) when reset is generated, and saves and loads data between a volatile memory device and a nonvolatile memory device depending on the cause(s), and further relates to an information recording medium which has recorded a program implementing this device and method.
2. Description of Related Art
Today, information processing devices such as widely-used business computers, portable information terminals, and computer game devices are wide spread and widely used.
In this type of information processing device, a CPU (Central Processing Unit) processes various data using a volatile memory device (main memory device) such as a RAM (Random Access Memory). A program which implements the processing executed by the CPU is stored in a ROM (Read Only Memory). When a power source of the information processing device is turned on, the CPU reads and executes a stored program called a bootloader from a fixed address of the ROM.
When the data processed by the CPU needs to be held, a method is used in which, even when the power source of the information processing device main body is turned off, the power source is supplied to the RAM, and a refresh clock is given. Furthermore, there is a method in which, by using SRAM as the RAM, a supply of a refresh clock is not needed. In addition, a method is also used in which data stored in the RAM is stored in a nonvolatile memory device (second memory device) such as a flash EEPROM (Electrically Erasable Programmable ROM), a hard disk, or a floppy disk.
For example, in an OS (Operating System) such as Windows CE (Windows is a registered trademark of Microsoft Corporation) which has been currently disseminated, there is a principle in which data is stored in a RAM, and even when the power source of the information processing device main body is turned off, electricity is supplied to the RAM, and the data which is stored in RAM is maintained.
Meanwhile, there are cases such that, due to malfunction of an application program itself managed by the OS of the information processing device, the operation of the program runs away in the middle of the program, the program falls into an infinite loop, or reset is generated by an address of the main memory device which cannot be used being accessed. Furthermore, there are cases such that as the user of the information processing device voluntarily presses a reset button, an SMI (Software Management Interrupt) is generated, the program which has run away is stopped, and the operation is restarted by resetting.
When the reset is thus generated, the CPU executes the above-mentioned bootloader and initializes and clears the RAM as part of the bootloader processing.
In particular, in an OS which provides a non-preemptive multi-task environment, such as Windows 3.1, a plurality of application programs can be simultaneously operated, but if any of the programs runs away, the entire information processing device has to be reset and the OS has to be reactivated.
In addition, in some information processing devices, a shut down function is provided which is not managed by the OS. An SMI interruption is generated by pressing and operating a suspend button, for example, data, application programs, programs of the OS main body, and/or the like stored in the RAM are saved in a hard disk or the like, in this interruption processing, and then the power source of the information processing device itself is shut down. After this, when the power source button is pressed and operated, the data and program(s) stored in the hard disk or the like are loaded into the RAM, and interruption processing is completed, and the system moves to the OS management. This is known as a hibernation function.
In addition, depending on the information processing device, there are cases such that the OS informs the application program of the shut down message, and the program which has been thus informed saves data, and then the power source is turned off.
However, the following problems exist in conventional information processing devices.
First, when a reset is generated for some reason, there is a problem such that in an information processing device in which the CPU executes the bootloader, because RAM is initialized and cleared, the data which has been processed by the operation up to that point is all erased, and the operation has to be reexecuted.
In particular, in an OS such as Windows CE, which has a format in which data is maintained in the RAM as a rule, there is a problem such that the information stored up to present was all erased. Furthermore, in an OS such as Windows 3.1, which provides a non-preemptive multi-task, there is a problem such that the data processed by an application program(s) which are operating normally, in addition to data processed by the application program that has run away, is all erased.
Furthermore, there is a problem such that a transition to the SMI interruption processing is needed during the OS operation in the information processing device with a hibernation function, and there is a possibility that the system might become unstable, and particularly when the pressing operation of the suspend button is performed while the OS has access to the hard disk, there is a risk that data on the hard disk might be erased.
Additionally, there is a problem such that if there is an abnormal condition in the middle of the application in a state in which the OS sends a sequential shutdown message to the application, the following application cannot save data, and the OS cannot voluntarily turn off the power source of the information processing device.
This invention reflects the above-mentioned problems, and an object of this invention is to provide an information processing device, and a method of saving and loading data, which determines the cause(s) when reset is generated and which saves and loads the data between a volatile memory device and a nonvolatile memory device according to the cause(s), and also relates to an information recording medium which records a program which implements this device and method.
In order to accomplish the above objects, the following invention is disclosed according to the principles of this invention.
An information processing device of this invention is provided with a volatile memory device, a nonvolatile memory device, a determination unit, a saving unit, and a loading unit, and
the volatile memory device stores data in a volatile manner,
the nonvolatile memory device stores data in a nonvolatile manner, and
the determination unit determines the cause of a reset which has been generated.
When the cause of the reset is determined by the determination unit to be a specified cause, the saving unit saves data which has been stored in the volatile memory device in the nonvolatile memory device, and when the cause of the reset is determined by the determination unit not to be a specified cause, the loading unit loads data which has been stored in the nonvolatile memory device to the nonvolatile memory device.
Here, specified causes include cases in which a user wants to stop the information processing device in a normal manner, such as a pressing operation of a suspend button or a shutdown instruction to the OS by the user, and also cases in which the reset is abnormally generated in the information processing device, such as by a pressing operation of a reset button or a reset generation by an erroneous memory access or the like.
Meanwhile, non-specified causes include cases in which the power source of the information processing device is turned on by a pressing operation of the power source button of the information processing device.
Furthermore, the determination device of the information processing device of this invention can be structured so as to perform determinations based on whether the data which is stored in the volatile memory device is valid.
Additionally, the loading device of the information processing device of this invention can be structured so as to determine whether the data stored in the nonvolatile memory device is valid, and load the data to the volatile memory device when the data is valid.
Furthermore, the information processing device of this invention can be structured so as to be provided with a stopping unit and a starting unit.
The stopping unit stops the operation of the information processing means when the data has been saved by the saving unit.
The starting unit begins the operation of the operating system of the information processing device when the data has been loaded by the loading unit.
Furthermore, the saving unit of the information processing device of this invention can be structured so as to save data in a format that can be managed by the operating system of the information processing device.
A method of saving and loading the data of this invention can be implemented by an information processing device which is provided with a volatile memory device and a nonvolatile memory device, and the following steps are provided.
A determination step is provided which determines a cause of a generated reset.
A saving step is provided which saves data which has been stored in the volatile memory device in the nonvolatile memory device when the cause of the reset is determined in the determination step to be a specified cause.
A loading step is provided which loads data which has been stored in the nonvolatile memory device to the volatile memory device when the cause of the reset is determined in the determination step to be a non-specified cause.
The determination step in the method of saving and loading data of this invention can be structured so as to determine based on whether the data stored in the volatile memory device is valid.
The loading step in the method of saving and loading data of this invention can be structured so as to determine whether the data stored in the nonvolatile memory device is valid, and to load the data to the volatile memory device when the data is valid.
The method of saving and loading data of this invention can be further structured with the following steps:
a stopping step which stops the operation of the information processing device when the data has been saved in the saving step, and
a starting step which begins the operation of the operating system of the information processing device when the data has been loaded in the loading step.
The saving step in a method of saving and loading data of this invention can be structured to save data in a format that can be managed by the operating system of the information processing device.
A program which implements the method of saving and loading data and the information processing device can be stored on an information recording medium such as a compact disk, a floppy disk, a hard disk, a photomagnetoelectric disk, a digital video disk, a magnetic tape, or a semiconductor memory.
This program is a so-called bootloader, and is executed when the information processing device is reset, and can be stored in the ROM of the information processing device. This program can also be arranged in a server computer of the WWW (World Wide Web), and the operator can appropriately download the program and store the program in the information processing device, and the program can be updated.